package com.shujia.scala

object Demo21Tuple {
  def main(args: Array[String]): Unit = {
    /**
     * tuple:元组,最多22个元素
     *
     */


    //5元组
    val tuple2: (Int, Int, Int, Int, Int) = Tuple5(1, 2, 3, 4, 5)
    println(tuple2)

    //简写
    val tuple1: (Int, Int, Int, Int, Int) = (1, 2, 3, 4, 5)
    //可以通过下标获取数，不会出现下标越界的异常
    println(tuple1._2)


  }

}
